home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / unique_array < prev    next >
Text File  |  2001-04-06  |  1KB  |  31 lines

  1. SYNOPSIS
  2.         mixed unique_array(object *obarr, string seperator)
  3.         mixed unique_array(object *obarr, string seperator, mixed skip)
  4.  
  5. DESCRIPTION
  6.         Groups objects together for which the separator function
  7.         returns the same value. obarr should be an array of objects,
  8.         other types are ignored. The separator function is called only
  9.         once in each object in obarr. If no separator function is
  10.         given, 0 is used instead of a return value.
  11.         If a 3rd argument is given and this argument matches the
  12.         return value of the separator function this object will not be
  13.         included in the returned array. The returned array is an array
  14.         of arrays of objects in the form:
  15.         
  16.         ({ ({ Same1:1, Same1:2, ... Same1:N }),
  17.            ({ Same2:1, Same2:2, ... Same2:N }),
  18.               ....
  19.            ({ SameM:1, SameM:2, ... SameM:N }) })
  20.  
  21. EXAMPLE
  22.         mixed *arr;
  23.         arr=unique_array(users(), "_query_level", -1);
  24.         
  25.         This will return an array of arrays holding all user objects
  26.         grouped together by their user levels. Wizards have a user
  27.         level of -1 so they will not appear in the the returned array.
  28.         
  29. SEE ALSO
  30.         filter(E), map(E)
  31.